import request from '@/utils/request'

export function login(username, password) {
  return request({
    url: '/admin/auth/login',
    method: 'post',
    data: {
      tel: username,
      password,
      force: 1
    }
  })
}

export function getInfo(token) {
  return request({
    url: '/admin/auth/userInfo',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/api/logout',
    method: 'post'
  })
}

export function register(user) {
  return request({
    url: '/api/register',
    method: 'post',
    params: { user }
  })
}
